package bean;

import java.sql.Connection;
import java.sql.DriverManager;

public class MyOracle
{
	Connection conn;//가장 중요!!
	
	
	public MyOracle()//생성자에서 모든일이 끝남
	{
		String driver = "oracle.jdbc.driver.OracleDriver";
		//String url = "jdbc:oracle:thin:@192.168.10.104:1521:xe";
		String url = "jdbc:oracle:thin:@127.0.0.1:1521:xe";
		String mid = "hr";
		String pwd = "hr";
		
		try
		{
			Class.forName(driver);
			//System.out.println("드라이버가 로딩됨.");
			
			conn = DriverManager.getConnection(url, mid, pwd);
			//System.out.println("connection 생성..");
		}
		catch(Exception ex)
		{
			ex.printStackTrace();
		}
	}
	
	public Connection getConn()
	{
		return conn;
	}

	public static void main(String[] args) 
	{
		new MyOracle();
	}
}















